package inter;

import gui.GUI;
import lexer.Lexer;

public class Node {

	private int lexLine = 0;
	private static int labels = 0;
	
	public Node(){
		lexLine = Lexer.getLinha();
	}
	
	protected void error(String s){
		GUI.textAreaSaida.setText("SOSCompiler: Erro na linha " + lexLine + ": " + s);
		throw new Error("SOSCompiler: Erro na linha " + lexLine + ": " + s);
	}
	
	public int newLabel(){
		labels++;
		return labels;
	}
	
	public void emitLabel(int i){
		GUI.textAreaSaida.setText( GUI.textAreaSaida.getText().toString() +  "\nL" + i + ":");
	}
	
	public void emit(String s){
		GUI.textAreaSaida.setText( GUI.textAreaSaida.getText().toString() +  "\n\t" + s);
	}
	
}
